# Copyright 2023 Ant Group Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:psi.bzl", "psi_cc_binary", "psi_cc_library", "psi_cc_test")

package(default_visibility = ["//visibility:public"])

psi_cc_library(
    name = "rr22_oprf",
    srcs = ["rr22_oprf.cc"],
    hdrs = ["rr22_oprf.h"],
    deps = [
        "//psi/psi/core/vole_psi/okvs:aes_crhash",
        "//psi/psi/core/vole_psi/okvs:baxos",
        "@yacl//yacl/base:buffer",
        "@yacl//yacl/crypto/primitives/vole/f2k:silent_vole",
        "@yacl//yacl/crypto/tools:prg",
        "@yacl//yacl/crypto/utils:rand",
        "@yacl//yacl/link",
        "@yacl//yacl/math/f2k",
        "@yacl//yacl/utils:parallel",
    ],
)

psi_cc_test(
    name = "rr22_oprf_test",
    srcs = ["rr22_oprf_test.cc"],
    deps = [
        ":rr22_oprf",
        "//psi/psi/utils:test_utils",
    ],
)

psi_cc_library(
    name = "rr22_psi",
    srcs = ["rr22_psi.cc"],
    hdrs = ["rr22_psi.h"],
    deps = [
        ":rr22_oprf",
        ":rr22_utils",
        "//psi/psi/utils",
    ],
)

psi_cc_test(
    name = "rr22_psi_test",
    srcs = ["rr22_psi_test.cc"],
    deps = [
        ":rr22_psi",
        "@yacl//yacl/crypto/utils:rand",
    ],
)

psi_cc_binary(
    name = "rr22_psi_bench",
    srcs = ["rr22_psi_bench.cc"],
    deps = [
        ":rr22_psi",
        "//psi/psi/utils:test_utils",
        "@com_github_google_benchmark//:benchmark_main",
        "@yacl//yacl/crypto/utils:rand",
    ],
)

psi_cc_library(
    name = "rr22_utils",
    srcs = ["rr22_utils.cc"],
    hdrs = ["rr22_utils.h"],
    deps = [
        "//psi/psi/core/vole_psi/okvs:galois128",
        "//psi/psi/core/vole_psi/okvs:simple_index",
        "@com_github_ridiculousfish_libdivide//:libdivide",
        "@com_github_sparsehash_sparsehash//:sparsehash",
        "@yacl//yacl/base:buffer",
        "@yacl//yacl/base:int128",
        "@yacl//yacl/link",
    ],
)

psi_cc_library(
    name = "sparsehash_config",
    hdrs = ["sparseconfig.h"],
    include_prefix = "sparsehash/internal",
    visibility = ["//visibility:public"],
)
